package com.ryskoo.cms.advertpicrel.repository;

import com.ryskoo.cms.advertpicrel.domain.AdvertPicRelPO;
import com.ryskoo.framework.core.repository.BasicJPAImpl;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

/**
 * @author thq
 * @data 2018-05-03
 */
@Repository
public class AdvertPicRelJPAImpl extends BasicJPAImpl<AdvertPicRelPO> implements IAdvertPicRelRepository {

	
	/**
	 * 根据广告Id删除广告图片
	 * @param advertId
	 */
	@Override
	public void deleteByAdvertId(String advertId) {
		StringBuilder sql = new StringBuilder("delete from AdvertPicRelPO where advertId = :advertId");
		Query q = this.getH4Session().createQuery(sql.toString());
		q.setString("advertId", advertId);
		q.executeUpdate();
	}
}
